package com.qen.enums;

import com.qen.wrapper.ISqlSegment;
import lombok.AllArgsConstructor;

/**
 * SQL 保留关键字枚举
 *
 * @author licz
 * @since 1.0.0
 */
@AllArgsConstructor
public enum SqlKeyword implements ISqlSegment {
    COUNT("COUNT(1)"),
    VALUES("VALUES"),
    DUPLICATE("ON DUPLICATE KEY UPDATE"),
    SELECT("SELECT"),
    INSERT("INSERT INTO"),
    DELETE("DELETE"),
    UPDATE(" UPDATE "),
    SET(" SET "),
    LIMIT_START("QEN_START"),
    LIMIT_SIZE("QEN_SIZE"),
    FROM("FROM"),
    LIMIT("LIMIT"),
    WHERE(" WHERE "),
    AND(" AND "),
    OR("OR"),
    NOT("NOT"),
    IN("IN"),
    NOT_IN("NOT IN"),
    LIKE("LIKE"),
    NOT_LIKE("NOT LIKE"),
    EQ(" = "),
    NE("<>"),
    GT(">"),
    GE(">="),
    LT("<"),
    LE("<="),
    IS_NULL("IS NULL"),
    IS_NOT_NULL("IS NOT NULL"),
    GROUP_BY("GROUP BY"),
    HAVING("HAVING"),
    ORDER_BY("ORDER BY"),
    EXISTS("EXISTS"),
    NOT_EXISTS("NOT EXISTS"),
    BETWEEN("BETWEEN"),
    NOT_BETWEEN("NOT BETWEEN"),
    ASC("ASC"),
    AS(" AS "),
    ON(" ON "),
    JOIN(" JOIN "),
    LEFT_JOIN("LEFT JOIN"),
    RIGHT_JOIN("RIGHT JOIN"),
    INNER_JOIN("INNER JOIN"),
    FULL_JOIN("FULL JOIN"),
    Key("key"),
    DESC("DESC");

    private final String keyword;

    @Override
    public String getSqlSegment() {
        return this.keyword;
    }
}
